<!doctype html>
<html>
    
        <meta charset="utf-8">
        <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" > 
        <title>用户登录</title>
        <link rel="stylesheet" type="text/css" href="./weipan/css/pubic.css" />
        <link rel="stylesheet" type="text/css" href="./weipan/css/other.css" />
        <link rel="stylesheet" href="./weipan/css/ui-dialog.css">
        <script src="./weipan/js/jquery-1.7.2.js"></script>
        <script src="./weipan/js/dialog-plus.js" type="text/javascript"></script>

        <script src="./weipan/js/jquery.smsSend.js" type="text/javascript"></script>
        <script src="./weipan/js/base64.js" type="text/javascript"></script>
    </head>

    <body>
        <div class="form_box">
            <!---------- logo内容 ----------> 
            <div class="logo_box">
                <img src="./weipan/images/logo.png">
                <h1>中部微交易系统</h1>
            </div>

            <!---------- 表单内容 ----------> 
            <form action="">
                <div class="type_box login_type">
                    <div class="type_name">账　户</div>
                    <div class="input_box"><input type="text" placeholder="请输入手机号" name="" id="mobile" value=""></div>
                </div>

                <div class="type_box login_type">
                    <div class="type_name">密　码</div>
                    <div class="input_box"><input type="password" placeholder="请输入密码" name="" id="password"></div>
                </div>

                <div class="type_box login_type">
                    <div class="type_name">验证码</div>
                    <div class="input_box"><input type="text" placeholder="请输入验证码" name="" id="vcode"></div>
 <div class="check_pic"><img id='code_click' src="http://weipan.zbdzwjy.com/App/Common/Common/vcode.php?height=40&width=100" onclick="this.src = 'http://weipan.zbdzwjy.com/App/Common/Common/vcode.php?height=40&width=100&time=' + Math.random()"></div>
                </div>                
                <div class="type_word">
                        <label for=""><input name="" type="checkbox" class="checkbox" id="remember" checked>记住账号</label>
                        <a href="http://weipan.zbdzwjy.com/index.php?m=admin&c=index&a=forget">忘记密码？</a>
                      </div>
                <div class="type_butn">
                    <input type="button" id="okBtn" value="立即登录">
                    <p>还没有账户？<a href="http://weipan.zbdzwjy.com/index.php?m=admin&c=index&a=open_account">立即注册</a></p>
                </div>
            </form>
        </div>
    </body>
    <script>
        $("#okBtn").click(function(){
            $("#okBtn").attr("disabled",true);
            var b = new Base64();

            var loginName = $("#mobile").val();
            var password = b.encode($("#password").val());
            var vcode = $("#vcode").val();
            var remember = $("#remember").prop("checked");
            // var code=$("#code").val();
            remember = remember?1:0;
            $.ajax({
                url:'http://weipan.zbdzwjy.com/index.php?m=admin&c=index&a=login&dosubmit=1',
                type: "post",
                dataType:"json",
                data:{
                    loginName:loginName,
                    password:password,
                    vcode:vcode,
                    remember:remember

                },
                error:function(){
                    $("#okBtn").attr("disabled",false);
                    var d = dialog({
                        title: '提示',
                        content: '网络链接超时，请检查您的网络!',
                        okValue: '确定',
                        ok: function () {}
                    });
                    d.showModal();

                },
                success:function(data){
                    if (data.info == "200"){

                        window.location.href = 'index.php?m=admin&c=index&a=trade';
                    } else{

                        $("#okBtn").attr("disabled",false);
                        var d = dialog({
                            title: '提示',
                            content: (data.info),
                            okValue: '确定',
                            ok: function () {}
                        });
                        d.showModal();
                    }
                }
            });
        });

        $("input").bind('keypress',function(event){
            if(event.keyCode == "13")
            {
                $('#okBtn').click();
                $("#okBtn").attr("disabled",true);
            }
        });
    </script>
</html>